package com.liu.mhl.Server;

import com.liu.mhl.dao.EmployeeDao;
import com.liu.mhl.domain.Employee;

import java.util.List;

public class EmployeeServer  {
    private EmployeeDao employeeDao = new EmployeeDao();
    //根据empId和pwd返回一个Employee对象
    //如果查询不到返回一个null
    //相当于员工登录
    public Employee getEmployeeByIdAndPwd(String empId, String pwd) {
      return employeeDao.querySingle("select * from employee where empid = ? and pwd = md5(?)", Employee.class, empId, pwd);
    }
    //返回一个员工的详细情景
    public List<Employee> getEmployee(){
        return employeeDao.queryMulti("select * from employee ", Employee.class);
    }
}
